package com.alison.base;

import cn.hutool.core.io.FileUtil;

import java.nio.charset.StandardCharsets;

/**
 * @Author alison
 * @Date 2024/4/11 19:42
 * @Version 1.0
 * @Description
 */
public class FileTest {
    final static String path = "D:\\workspace\\lab\\learnbigdata\\learnflink\\flink-datastream\\src\\main\\java\\com\\alison\\datastream\\exactlyonce\\e1.dat";

    public static void main(String[] args) {
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            System.out.println("hahahaha ");
        }));
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            try {
                FileUtil.writeString(String.valueOf(1), path, StandardCharsets.UTF_8);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }));
        for (; ; ) {
        }
//        FileUtil.writeString(String.valueOf(22), path, StandardCharsets.UTF_8);
    }
}
